package com.parsechina.hpush.broker.spi;

import com.parsechina.hpush.broker.internal.message.NotifyAcknowledgedMessage;
import com.parsechina.hpush.broker.internal.subscriptions.Subscription;
import com.parsechina.hpush.broker.parser.ConnectMessage;
import com.parsechina.hpush.broker.parser.PublishMessage;
import io.netty.buffer.ByteBuf;


/**
 * @author linfeng-eqxiu
 */
public interface IMessaging {

    void notifyClientConnected(ConnectMessage msg);

    void notifyClientDisconnected(String clientId, String username);

    void notifyClientConnectionLost(String clientId, String username);

    void notifyTopicPublished(PublishMessage msg, String clientId, final String username);

    void notifyTopicSubscribed(Subscription sub, final String username);

    void notifyTopicUnsubscribed(String topic, String clientId, final String username);

    void notifyMessageAcknowledged(NotifyAcknowledgedMessage msg);

    void notifyIOSPush(ByteBuf msg, String clientId);

}
